/*
 * Copyright (c) 2023 Huawei Technologies Co., Ltd.
 * openUBMC is licensed under Mulan PSL v2.
 * You can use this software according to the terms and conditions of the Mulan PSL v2.
 * You may obtain a copy of Mulan PSL v2 at:
 *         http://license.coscl.org.cn/MulanPSL2
 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
 * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
 * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
 * See the Mulan PSL v2 for more details.
 */

#ifndef GEN_OBJECT_PCIeNicCard_H
#define GEN_OBJECT_PCIeNicCard_H

#include <device_tree/interface/Board.h>
#include <device_tree/interface/NetworkAdapter.h>
#include <device_tree/interface/NetworkAdapter/Cooling.h>
#include <device_tree/interface/NetworkAdapter/FaultStatus.h>
#include <device_tree/interface/NetworkAdapter/LogCollection.h>
#include <device_tree/interface/PCIeCard.h>
#include <device_tree/interface/PCIeDevice.h>
#include <device_tree/interface/PCIeDevice/Bandwidth.h>

namespace dev::gen {

/**
 * @brief PCIe网卡驱动类
 *
 * 实现PCIe网卡的驱动功能
 */
class MC_API pcie_nic_card : public mc::engine::object<pcie_nic_card> {
public:
    MC_OBJECT(
        pcie_nic_card, "PCIeNicCard", "/bmc/dev/Systems/${SystemId}/PCIeNic/${Id}",
        (PCIeDevice)(PCIeCard)(NetworkAdapter)(NetworkAdapter_FaultStatus)(NetworkAdapter_Cooling)(Board)(PCIeDevice_Bandwidth)(NetworkAdapter_LogCollection))

    virtual bool init(const mc::dict& config) = 0;
    virtual bool stop()                       = 0;
    virtual bool start()                      = 0;

    PCIeDevice                   m_pcie_device;
    PCIeCard                     m_pcie_card;
    NetworkAdapter               m_network_adapter;
    NetworkAdapter_FaultStatus   m_network_adapter_fault_status;
    NetworkAdapter_Cooling       m_network_adapter_cooling;
    Board                        m_board;
    PCIeDevice_Bandwidth         m_pcie_device_bandwidth;
    NetworkAdapter_LogCollection m_network_adapter_log_collection;
};

} // namespace dev::gen

#endif // GEN_OBJECT_PCIeNicCard_H